﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Nhaxuatban.aspx.cs" Inherits="NCKH.Admin.Nhaxuatban" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="margin:2px 5px auto 60px">
       <h2 style="color:red; text-align:left">Quản lý nhà xuất bản</h2><br />
       <table style="margin-left:90px" >
           <tr>
               <td>Tên nhà xuất bản</td>
               <td><asp:TextBox ID="txtNXB" runat="server"></asp:TextBox></td>
               <td>
                   <asp:RequiredFieldValidator ID="rpvTenNXB" runat="server"
                        ControlToValidate="txtNXB" Text="Thiếu tên nhà xuất bản">*
                    </asp:RequiredFieldValidator>
                   <asp:Label ID="lblNXB" runat="server"></asp:Label>
                   
               </td>
           </tr>
           <tr>
               <td>Số điện thoại</td>
               <td><asp:TextBox ID="txtSDT" runat="server"></asp:TextBox></td>
               <td>
                   <asp:RequiredFieldValidator ID="rpvSDT" runat="server"
                       ControlToValidate="txtSDT" Text="Thiếu số điện thoại">*</asp:RequiredFieldValidator>
               </td>
           </tr>
           <tr>
               <td>Fax</td>
               <td><asp:TextBox ID="txtFax" runat="server"></asp:TextBox></td>
               <td>
                   <asp:RequiredFieldValidator ID="rpvFax" runat="server"
                   ControlToValidate="txtFax" Text="Thiếu Fax">*</asp:RequiredFieldValidator>
               </td>
               
           </tr>
           <tr>
               <td>Địa chỉ</td>
               <td><asp:TextBox ID="txtDiachi" runat="server"></asp:TextBox></td>
               <td>
                   <asp:RequiredFieldValidator ID="rpvDiachi" runat="server"
                       ControlToValidate="txtDiachi" Text="Thiếu địa chỉ">*</asp:RequiredFieldValidator>
               </td>
           </tr>
           <tr>
               <td></td>
               <td><asp:Button ID="btnThem" runat="server" Text="Thêm mới" OnClick="btnThem_Click"/>
                   <asp:Button ID="btnBoqua" runat="server" Text="Bỏ qua" CausesValidation="false" OnClick="btnBoqua_Click"/>
               </td>
           </tr>
       </table><br />
    <%-- GridView --%>
    <asp:GridView ID="grvnhaxuatban" runat="server" AutoGenerateColumns="False" CellSpacing="25" CellPadding="20" 
            EnableModelValidation="True" 
            onrowcommand="grvNhaxuatban_RowCommand" Width="627px"
            Caption="<h2>Danh sách nhà xuất bản</h2>">
            
            
         <Columns>
                <asp:BoundField DataField="TenNXB" HeaderText="Tên nhà xuất bản" SortExpression="TenNXB" />
                <asp:BoundField DataField="SDT" HeaderText="Số điện thoại" />
                <asp:BoundField DataField="Fax" HeaderText="Fax" />
                <asp:BoundField DataField="Diachi" HeaderText="Địa chỉ " />
                
                <asp:TemplateField HeaderText="&nbsp;Xoá &nbsp;">
                    <ItemTemplate>
                        <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="false" 
                        CommandName="xoa" 
                        CommandArgument='<%# Eval("MaNXB") %>'
                        OnClientClick='return confirm("Bạn có chắc chắn muốn xoá không?");'>Xoá</asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="&nbsp;Sửa &nbsp;">
                    <ItemTemplate>
                        <a href='Nhaxuatban_Sua.aspx?pid=<%# Eval("MaNXB") %>'>Sửa</a>
                    </ItemTemplate>
                </asp:TemplateField>
             
            </Columns>
    </asp:GridView>
    </div>
</asp:Content>
